<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 30] 30.12 java.util.Locale (JDK 1.1)</TITLE>
<META NAME="author" CONTENT="David Flanagan">
<META NAME="date" CONTENT="Thu Jul 31 16:34:59 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java in a Nutshell">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java in a Nutshell" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch30_11.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 30<br>The java.util Package</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch30_13.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=sect1>
<h2 CLASS=sect1><A CLASS="TITLE" NAME="JNUT2-CH-30-SECT-12">30.12 java.util.Locale (JDK 1.1)</A></h2>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-30-SECT-12.1"></A></h3>
</DIV>

<P CLASS=para>
The <tt CLASS=literal>Locale</tt> class represents a locale: a political,
geographical, or cultural region that typically has a
distinct language and distinct customs and conventions for
such things as formatting dates, times, and numbers.

<P CLASS=para>
The <tt CLASS=literal>Locale</tt> class defines a number of constants that
represent commonly used locales.  <tt CLASS=literal>Locale</tt> also
defines a static <tt CLASS=literal>getDefault()</tt> method that returns
the default <tt CLASS=literal>Locale</tt> object, which represents a locale
value inherited from the host system.  Furthermore, many
locale-sensitive classes, such as <tt CLASS=literal>DateFormat</tt>,
provide <tt CLASS=literal>getAvailableLocales()</tt> methods that return a
list of supported <tt CLASS=literal>Locale</tt> objects.  If none of these
methods for obtaining a <tt CLASS=literal>Locale</tt> object is suitable,
you can also explicitly create your own <tt CLASS=literal>Locale</tt>
object.  To do this, you must specify a language code, a
country code, and an optional variant string.

<P CLASS=para>
The <tt CLASS=literal>Locale</tt> class does not implement any
internationalization behavior itself; it merely serves as a
locale identifier for those classes that can localize their
behavior.  Given a <tt CLASS=literal>Locale</tt> object, you can invoke the
various <tt CLASS=literal>getDisplay</tt> methods to obtain a
description of the locale suitable for display to a user.
Note that these methods may themselves take a <tt CLASS=literal>Locale</tt>
argument so that the names of languages and countries can be
localized as appropriate.

<DIV CLASS=screen>
<P>
<PRE>
public final class <tt CLASS=literal>Locale</tt> extends Object implements Cloneable, Serializable {
    // <tt CLASS=literal>Public Constructors</tt>
            public <tt CLASS=literal>Locale</tt>(String <tt CLASS=literal>language</tt>, String <tt CLASS=literal>country</tt>, String <tt CLASS=literal>variant</tt>);
            public <tt CLASS=literal>Locale</tt>(String <tt CLASS=literal>language</tt>, String <tt CLASS=literal>country</tt>);
    // <tt CLASS=literal>Constants</tt>
            public static final Locale <tt CLASS=literal>CANADA</tt>;
            public static final Locale <tt CLASS=literal>CANADA_FRENCH</tt>;
            public static final Locale <tt CLASS=literal>CHINA</tt>;
            public static final Locale <tt CLASS=literal>CHINESE</tt>;
            public static final Locale <tt CLASS=literal>ENGLISH</tt>;
            public static final Locale <tt CLASS=literal>FRANCE</tt>;
            public static final Locale <tt CLASS=literal>FRENCH</tt>;
            public static final Locale <tt CLASS=literal>GERMAN</tt>;
            public static final Locale <tt CLASS=literal>GERMANY</tt>;
            public static final Locale <tt CLASS=literal>ITALIAN</tt>;
            public static final Locale <tt CLASS=literal>ITALY</tt>;
            public static final Locale <tt CLASS=literal>JAPAN</tt>;
            public static final Locale <tt CLASS=literal>JAPANESE</tt>;
            public static final Locale <tt CLASS=literal>KOREA</tt>;
            public static final Locale <tt CLASS=literal>KOREAN</tt>;
            public static final Locale <tt CLASS=literal>PRC</tt>;
            public static final Locale <tt CLASS=literal>SIMPLIFIED_CHINESE</tt>;
            public static final Locale <tt CLASS=literal>TAIWAN</tt>;
            public static final Locale <tt CLASS=literal>TRADITIONAL_CHINESE</tt>;
            public static final Locale <tt CLASS=literal>UK</tt>;
            public static final Locale <tt CLASS=literal>US</tt>;
    // <tt CLASS=literal>Class Methods</tt>
            public static synchronized Locale <tt CLASS=literal>getDefault</tt>();
            public static synchronized void <tt CLASS=literal>setDefault</tt>(Locale <tt CLASS=literal>newLocale</tt>);
    // <tt CLASS=literal>Public Instance Methods</tt>
            public Object <tt CLASS=literal>clone</tt>();  //<tt CLASS=literal> Overrides Object</tt>
            public boolean <tt CLASS=literal>equals</tt>(Object <tt CLASS=literal>obj</tt>);  //<tt CLASS=literal> Overrides Object</tt>
            public String <tt CLASS=literal>getCountry</tt>();
            public final String <tt CLASS=literal>getDisplayCountry</tt>();
            public String <tt CLASS=literal>getDisplayCountry</tt>(Locale <tt CLASS=literal>inLocale</tt>);
            public final String <tt CLASS=literal>getDisplayLanguage</tt>();
            public String <tt CLASS=literal>getDisplayLanguage</tt>(Locale <tt CLASS=literal>inLocale</tt>);
            public final String <tt CLASS=literal>getDisplayName</tt>();
            public String <tt CLASS=literal>getDisplayName</tt>(Locale <tt CLASS=literal>inLocale</tt>);
            public final String <tt CLASS=literal>getDisplayVariant</tt>();
            public String <tt CLASS=literal>getDisplayVariant</tt>(Locale <tt CLASS=literal>inLocale</tt>);
            public String <tt CLASS=literal>getISO3Country</tt>() throws MissingResourceException;
            public String <tt CLASS=literal>getISO3Language</tt>() throws MissingResourceException;
            public String <tt CLASS=literal>getLanguage</tt>();
            public String <tt CLASS=literal>getVariant</tt>();
            public synchronized int <tt CLASS=literal>hashCode</tt>();  //<tt CLASS=literal> Overrides Object</tt>
            public final String <tt CLASS=literal>toString</tt>();  //<tt CLASS=literal> Overrides Object</tt>
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-30-SECT-12.2">Passed To:</A></h3>

<P CLASS=para>
BreakIterator.getCharacterInstance(), 
BreakIterator.getLineInstance(), 
BreakIterator.getSentenceInstance(), 
BreakIterator.getWordInstance(), 
Calendar(), 
Calendar.getInstance(), 
Collator.getInstance(), 
Component.setLocale(), 
DateFormat.getDateInstance(), 
DateFormat.getDateTimeInstance(), 
DateFormat.getTimeInstance(), 
DateFormatSymbols(), 
DecimalFormatSymbols(), 
GregorianCalendar(), 
Locale.getDisplayCountry(), 
Locale.getDisplayLanguage(), 
Locale.getDisplayName(), 
Locale.getDisplayVariant(), 
Locale.setDefault(), 
MessageFormat.setLocale(), 
NumberFormat.getCurrencyInstance(), 
NumberFormat.getInstance(), 
NumberFormat.getNumberInstance(), 
NumberFormat.getPercentInstance(), 
ResourceBundle.getBundle(), 
SimpleDateFormat(), 
String.toLowerCase(), 
String.toUpperCase()

</DIV>

<DIV CLASS=sect2>
<h3 CLASS=sect2><A CLASS="TITLE" NAME="JNUT2-CH-30-SECT-12.3">Returned By:</A></h3>

<P CLASS=para>
Applet.getLocale(), 
BreakIterator.getAvailableLocales(), 
Calendar.getAvailableLocales(), 
Collator.getAvailableLocales(), 
Component.getLocale(), 
DateFormat.getAvailableLocales(), 
Locale.getDefault(), 
MessageFormat.getLocale(), 
NumberFormat.getAvailableLocales(), 
Window.getLocale()

</DIV>

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch30_11.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch30_13.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>java.util.ListResourceBundle (JDK 1.1)</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>java.util.MissingResourceException (JDK 1.1)</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
